import pandas as pd

# 加载数据
data = pd.read_csv('D:\yyxxaq_shiyan-master\data\salaries_cyber.csv')

# 1. 数据集的行数
num_rows = data.shape[0]
print("数据集一共有 %d 条数据。" % num_rows)

# 2. 数据集的列数
num_columns = data.shape[1]
print("数据集有 %d 列特征。" % num_columns)

# 3. 数据集的数值型和类别型特征
numeric_features = data.select_dtypes(include=['number']).columns
categorical_features = data.select_dtypes(include=['object']).columns
num_numeric_features = len(numeric_features)
num_categorical_features = len(categorical_features)
print("数据集有 %d 列数值型特征和 %d 列类别型特征。" % (num_numeric_features, num_categorical_features))

# 4. 数据集的缺失值
missing_values = data.isnull().sum().sum()
print("数据集有 %d 个缺失值。" % missing_values)

# 5. 每个列类别型特征的唯一类别数量
unique_categories = data[categorical_features].nunique()
print("每个列类别型特征的唯一类别数量：\n", unique_categories)
